//
//  SecondViewController.swift
//  TC_V1
//
//  Created by Casper Ng on 16/6/17.
//  Copyright © 2017 Casper Ng. All rights reserved.
//

import UIKit

class SecondViewController: UIViewController,UICollectionViewDelegate, UICollectionViewDataSource {
        
        var imageArroy = [UIImage(named:"pers_bbt"),UIImage(named:"pers_brew"),UIImage(named:"pers_gym"),UIImage(named:"pers_read"),UIImage(named:"pers_tc"),]
        
        var imageArroy2 = [UIImage(named:"pers_bbt"),UIImage(named:"pers_brew"),UIImage(named:"pers_gym"),UIImage(named:"pers_read"),UIImage(named:"pers_tc"),]
        
        
        override func viewDidLoad() {
            super.viewDidLoad()
            // Do any additional setup after loading the view, typically from a nib.
        }
        
        override func didReceiveMemoryWarning() {
            super.didReceiveMemoryWarning()
            // Dispose of any resources that can be recreated.
        }
    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
        return imageArroy.count
    }
    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "PersCollectionViewCell", for: indexPath) as! PersCollectionViewCell
        
        cell.imgImage2.image = imageArroy[indexPath.row]
        
        return cell
    }

    

}

